<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../style/ucs.css">
    <link rel="stylesheet" href="../content/font/iconfont.css">
    <link rel="stylesheet" href="../style/theme.css">
</head>
<body>
    <div id="giraffe"></div>
    <script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
    <script type="text/javascript" src="../../dist/libs/engine.js"></script>
    <script type="text/javascript" src="../../dist/libs/raphael.js"></script>
    <script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>

    <script>
        //项目列表模型
        var projectListDM = new UDM({
            value: []
        });
        //意见反馈
        var textareaDM = new UDM({
            validator:[
                {type:"require",msg:"内容不能为空"}
            ]
        });
        var emailDM = new UDM({
            placeholder:"请输入邮箱",
            validator:[
                {type:"require",msg:"邮箱不能为空"}
            ]
        });
        var feedbackDM = new Dialog({   //确认提交按钮
            confirmBack:function () {
                feedbackDM.hideDialog();    //关闭弹窗
            },
            closeBack: function () {
                feedbackDM.hideDialog();
            }
        });

        //累计数据
        var amountDM = new UDM({
            value:{
                unit:"元",
                CumulativeTransactionAmount:333,
                AccumulatedIncome:444
            }
        });

        //常见问题
        var questionsDM = new UDM({
            value:[]
        });

        //最新投资数据模型
        var investmentDM = new UDM({
            value:[]
        });

        //平台公告数据模型
        var noticesDM = new UDM({
            value:[]
        });

        //轮播图数据模型
        var bannersDM = new UDM({
            value:[
                {
                    Title:"",
                    OpenMode:"",
                    PicUrl:"",
                    LinkUrl:""
                }
            ]
        });

        //投资步骤数据模型
        var stepsDM = new UDM({
            value:[
                {
                    Title:"",
                    Description:"",
                    Address:""
                }
            ]
        });

        /*模拟后台返回数据*/
        //推荐列表
        var listValue = [
            {
                ProjectName: {
                    value: "1商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 1300.00,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 0,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:2,     //项目状态
                IsExclusive:{
                    value:false
                },
                IsExclusivePublic:{
                    value:false
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017/04/8 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: 1,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: "icon_xs.png|只有新用户才能投标,icon_qt.png,icon_jj.png"
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            },
            {
                ProjectName: {
                    value: "2商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 9600,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 20,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:1,     //项目状态
                IsExclusive:{
                    value:true
                },
                IsExclusivePublic:{
                    value:false
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017-03-22 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: 1,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: "icon_xs.png|只有新用户才能投标,icon_qt.png,icon_jj.png"
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            },
            {
                ProjectName: {
                    value: "3商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 100000,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 100,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:3,     //项目状态
                IsExclusive:{
                    value:true
                },
                IsExclusivePublic:{
                    value:true
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017-03-22 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: null,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: null
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            },
            {
                ProjectName: {
                    value: "4商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 6500000,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 60,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:1,     //项目状态
                IsExclusive:{
                    value:false
                },
                IsExclusivePublic:{
                    value:false
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017-03-22 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: null,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: null
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            },
            {
                ProjectName: {
                    value: "5商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 1200.05,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 100,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:3,     //项目状态
                IsExclusive:{
                    value:false
                },
                IsExclusivePublic:{
                    value:false
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017-03-22 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: null,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: null
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            },
            {
                ProjectName: {
                    value: "6商票理财【20160002】",
                    className: "aaa"
                },	//项目名称
                Interest: {
                    value: "6.30",
                    className: "bbb"
                },	//年化利率（%）
                Duration: {
                    value: "360",
                    className: ""
                },	//项目期限（天）
                TotalAmount: {
                    value: 9600,
                    className: ""
                },	//项目规模（百万）
                Progress: {
                    value: 100,
                    className: ""
                },	//投标进度(%)
                VFinancingStatus:3,     //项目状态
                IsExclusive:{
                    value:false
                },
                IsExclusivePublic:{
                    value:false
                },
                VFinancingStatusName: {
                    value: "预热中",
                    className: ""
                },	//投标状态文字
                ProjectBeginTime:{
                    value: "2017-03-22 12:12:12",
                    className:""
                },//项目开始时间
                ProjectType: {
                    value: 1,
                    className: ""
                },	//是否是专属项目
                MinAmount: {
                    value: "1000",
                    className: ""
                },   //起投金额
                Aflag_Icon:{
                    value: null
                },//活动标识
                LinkUrl:"../InvestList/index.html"  //链接
            }
        ];
        //累计数据
        var amountData = {
            CumulativeTransactionAmount:UFormatter.formatMoney(1111111),
            AccumulatedIncome:2222222
        };
        //常见问题
        var quesList = [
            {
                Title:"平台对投资者有什么要求111 ？",
                questionUrl:"http://ttmy.ucsmy.com/About/FAQ?key=1"
            },
            {
                Title:"为什么我会支付不成功 ？"
            },
            {
                Title:"平台对投资者有什么要求 ？",
                questionUrl:"http://ttmy.ucsmy.com/About/FAQ?key=1"
            },
            {
                Title:"平台对投资者有什么要求 ？",
                questionUrl:"http://ttmy.ucsmy.com/About/FAQ?key=1"
            },
            {
                Title:"平台对投资者有什么要求 ？",
                questionUrl:"http://ttmy.ucsmy.com/About/FAQ?key=1"
            }
        ];
        //最新投资ajax
        var InvestmentRecord = [
            {
                PayUserName:"张**",
                PayAmount:"100,000",
                PayTime:"2017-03-11"
            },
            {
                PayUserName:"李**",
                PayAmount:"9,900",
                PayTime:"2017-03-11"
            },
            {
                PayUserName:"赵**",
                PayAmount:"92,000",
                PayTime:"2017-03-11"
            },
            {
                PayUserName:"张**",
                PayAmount:"100,000",
                PayTime:"2017-03-11"
            },
            {
                PayUserName:"李**",
                PayAmount:"9,900",
                PayTime:"2017-03-11"
            },
            {
                PayUserName:"赵**",
                PayAmount:"92,000",
                PayTime:"2017-03-11"
            }
        ];
        //平台公告ajax
        var Notices = [
            {
                RecommendId:"ee43e3dc-76e8-4c75-b0ac-c0faef6aec27",
                LinkUrl:null,
                Title:"123456",
                OpenMode:"0",
                PicUrl: "",
                CreateDate:"2017-04-01"
            },
            {
                RecommendId:"0f093e05-760a-4389-86d1-d6b1256bbee7",
                LinkUrl:null,
                Title:"测试公告最新0825",
                OpenMode:"0",
                PicUrl: "",
                CreateDate:"2017-03-30"
            }
        ];
        //轮播图ajax
        var Banners = [
            {
                Title:"APP下载页",
                OpenMode:"1",
                PicUrl:"../content/images/banner.jpg",
                LinkUrl:"http://ttqp2016.ucsmy.com/download.html"
            },
            {
                Title:"APP下载页",
                OpenMode:"1",
                PicUrl:"../content/images/bg1.jpg",
                LinkUrl:"http://ttqp2016.ucsmy.com/download.html"
            },
            {
                Title:"APP下载页",
                OpenMode:"1",
                PicUrl:"../content/images/bg2.jpg",
                LinkUrl:"http://ttqp2016.ucsmy.com/download.html"
            }
        ];
        //投资步骤ajax
        var InvestmentGuide = [
            {
                Title:"Step1/注册",
                Description:"注册成为平台会员",
                Address:"../Register/index.html"
            },
            {
                Title:"Step2/投资",
                Description:"选择项目进行投资",
                Address:"home/list"
            },
            {
                Title:"Step3/绑卡支付",
                Description:"绑定回款账户并支付 ",
                Address:"center/addBank"
            },
            {
                Title:"Step4/收益",
                Description:"账户中心查看收益"
            }
        ];

        var ajaxFn = function(){
            //项目列表模型
            var curListValue = [];
            if(listValue.length>0){
                for(var i = 0 ; i < listValue.length ; i ++){
                    curListValue.push(listValue[i]);
                }
            }
            projectListDM.setValue(curListValue);
            setInterval(function(){
//                bannersDM.setValue(Banners);
//                stepsDM.setValue(InvestmentGuide);
//                projectListDM.setValue(curListValue);
            },1000);
        };
        var ajaxFn2 = function(){
            //累计数据
            amountDM.setValue(amountData);

            //常见问题
            if(quesList.length > 0){
                questionsDM.setValue(quesList);
            }

            //最新投资
            if(InvestmentRecord.length > 0){
                investmentDM.setValue(InvestmentRecord);
            }

            //平台公告
            if(Notices.length > 0){
                noticesDM.setValue(Notices);
            }

            //轮播图
            if(Banners.length > 0){
                bannersDM.setValue(Banners);
            }

            //投资步骤
            if(InvestmentGuide.length > 0){
                stepsDM.setValue(InvestmentGuide);
            }

        };

        //链接
        var URLDM = new UDM({
            value:{
                investList:"../InvestList/index.html",
                notices:"../PlatformNotice/index.html",
                questions:"",
                my:"../UserInfo/index.html",
                borrow:"../Borrow/index.html",
                downloadAndroid:"",
                downloadIOS:""
            }
        });
        //收益计算公式 360天
        var daysDM = new UDM({
            value:360
        });

        UEventHub.on('pageLoad', function(v){
            ajaxFn();
            ajaxFn2();
            console.log(v);
            /*UDialog.toast({
                title:"1111",
                content:"ddddddddd",
                autoClose:5,
                closeBack:function () {
                    console.log(123)
                }
            })*/
            UEventHub.emit("test","你好，","世界！");
        });

        var PageDM = {
            URL:URLDM,
            projectList: projectListDM,
            textarea:textareaDM,
            email:emailDM,
            amount:amountDM,
            investment:investmentDM,
            notices:noticesDM,
            banners:bannersDM,
            steps:stepsDM,
            questions:questionsDM,
            feedback:feedbackDM,
            days:daysDM
        }
    </script>
<script type="text/javascript" src="../Index\index.js"></script></body>
</html>